package com.weiyuwqj.controller.article;

import com.weiyuwqj.api.service.SysArticleService;
import com.weiyuwqj.api.common.Paginator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by zhangyong on 2016/11/29.
 */
@Controller
public class ArticleController {

    @Autowired
    SysArticleService articleService;

    /**
     * 文章列表siteId=7,8,9
     * @param p
     * @param siteId
     * @return
     */
    @ResponseBody
    @RequestMapping("/article/list")
    public Object list(Paginator p,Integer siteId){
        Map map=new HashMap();
        map.put("siteId",siteId);
        return null ; //articleService.getListAndPicture(p,map);
    }

    /**
     * 文章单个查询siteId=1,2,3,4,5,6
     */
    @ResponseBody
    @RequestMapping("/article/getArticleBySiteId")
    public Object getArticleBySiteId(Integer siteId){

        Map map=new HashMap();
        map.put("siteId",siteId);
        map.put("status",1);
        return null;//articleService.getArticleBySiteId(map);
    }

    /**
     * 单个查询
     * @param id
     * @return
     */
    @ResponseBody
    @RequestMapping("/article/getSysArticleById")
    public Object getSysArticleById(Integer id){
       return null;//articleService.getSysArticleById(id);
    }
}
